//全局组件
Vue.component("runoob", {
    props: ['hiht'],
    template: `<div><p v-for='l in hiht' @click="$emit('clie',index)">{{l}}</p></div>`,
});

Vue.component("com", {
    props: ['title'],
    template: `<div>{{title}}
    <ul v-for="(value,index) in list">
    <li @click="remove(index)">{{value}}</li>
    </ul>
    <button @click="$emit('clact',list)">传值</button>
    </div>`,
    data() {
        return {
            list: ["12341", "sgsfa", "5a9dad"]
        }
    },
    methods: {
        remove(index) {
            this.list.splice(index, 1)
        }
    }
});


new Vue({
    el: "#app",
    data: {
        list: ["awdawdadawda", "adadaawdf2432542"]
    },
    methods: {
        remove(index) {
            this.list.splice(index, 1)
        }
    }
})


new Vue({
    el: "#app1",
    data:{
        text:''
    },
    methods: {
        add(index){
            this.text=index;
        }
    }
})